export function convertFileToBase64(file: File): Promise<string> {
    return new Promise((resolve, reject) => {
        const reader = new FileReader();
        reader.onload = () => {
            if (reader.result) {
                const base64String = reader.result.toString();
                resolve(base64String);
            } else {
                reject("Failed to convert image to Base64");
            }
        };
        reader.onerror = () => reject(reader.error);
        reader.readAsDataURL(file); // Reads the file as a data URL (Base64)
    });
}
